package com.example.worddemo.doc_oper;

import com.spire.doc.*;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class TrackChanges2 {
    public static void main(String[] args){
       //加载测试文档
        Document doc = new Document("sample.docx");

        //判断文档是否有修改
        if (doc.hasChanges()) {
            log.info("doc has changed");
            //接受修订
            doc.acceptChanges();

            //拒绝修订
            //doc.rejectChanges();
        }else {
            log.info("doc has not change");
        }


        //保存文档
        doc.saveToFile("修订功能2.docx",FileFormat.Docx_2010);
    }
}